package ams

import (
	"fmt"
	"lib/utils"
)

var InsCode = struct {
	Ping, SetHandsUpArgus, SetGuarderArgus, SetFileServerAddr,
	HandsUp, SetId, UpdatePolicy, ExecutePlugin, Ack, SaveConfig,
	ExecSql,
	StartGuarder, StopGuarder string
}{
	Ping:              "Ping",
	SetHandsUpArgus:   "SetHandsUpArgus",
	SetGuarderArgus:   "SetGuarderArgus",
	SetFileServerAddr: "SetFileServerAddr",
	HandsUp:           "HandsUp",
	SetId:             "SetId",
	UpdatePolicy:      "UpdatePolicy",
	ExecutePlugin:     "ExecutePlugin",
	Ack:               "Ack",
	SaveConfig:        "SaveConfig",
	ExecSql:           "ExecSql",
	StartGuarder:      "StartGuarder",
	StopGuarder:       "StopGuarder",
}

var ResCode = struct {
	Ping, GetHandsUpArgus, HandsUp, GetId, CheckPluginList, CheckPolicy,
	ExecutePlugin, UploadLog, Ack string
}{
	Ping:            "Ping",
	GetHandsUpArgus: "GetHandsUpArgus",
	HandsUp:         "HandsUp",
	GetId:           "GetId",
	CheckPluginList: "CheckPluginList",
	CheckPolicy:     "CheckPolicy",
	ExecutePlugin:   "ExecutePlugin",
	UploadLog:       "UploadLog",
	Ack:             "Ack",
}

var BaseInstructContent = struct {
	SetHandsUpArgus, SetGuarderArgus, HandsUp string
}{
	SetHandsUpArgus: utils.Obj2Str(PluginInstruct{Cmd: Macp, Args: []string{SayHi, fmt.Sprintf("-mainPath=%s%s", ClientFolder, ClientMain)}, Env: ClientPluginFolder}),
	SetGuarderArgus: utils.Obj2Str(PluginInstruct{Cmd: Guarder, Args: []string{}}), //todo 守卫启动参数还未设置
	HandsUp:         utils.Obj2Str(PluginInstruct{Cmd: Macp, Args: []string{SayHi, fmt.Sprintf("-mainPath=%s%s", ClientFolder, ClientMain)}, Env: ClientPluginFolder}),
}
